package config

type AppConfig struct {
	Name      string `mapstructure:"name"`
	Mode      string `mapstructure:"mode"`
	Version   string `mapstructure:"version"`
	MachineID int64  `mapstructure:"machine_id"`
	Port      int    `mapstructure:"port"`

	*MySQL `mapstructure:"mysql"`

	*Jwt `mapstructure:"jwt"`

	*Zap `mapstructure:"zap"`
}

type MySQL struct {
	Host         string `mapstructure:"host"`
	Username     string `mapstructure:"username"`
	Password     string `mapstructure:"password"`
	Port         int    `mapstructure:"port"`
	Charset      string `mapstructure:"charset"`
	ParseTime    string `mapstructure:"parse_time"`
	Loc          string `mapstructure:"loc"`
	Collate      string `mapstructure:"collate"`
	MaxOpenConns int    `mapstructure:"max_open_conns"`
	MaxIdleConns int    `mapstructure:"max_idle_conns"`
	DbName       string `mapstructure:"dbname"`
}

type Jwt struct {
	Secret    string `mapstructure:"secret"`
	ExpiresAt int64  `mapstructure:"expires_at"`
	Issuer    string `mapstructure:"issuer"`
}

type Zap struct {
	Level      int    `mapstructure:"level"`
	Directory  string `mapstructure:"directory"`
	Format     string `mapstructure:"format"`
	MaxSize    int    `mapstructure:"max_size"`
	MaxAge     int    `mapstructure:"max_age"`
	MaxBackups int    `mapstructure:"max_backups"`
	Compress   bool   `mapstructure:"compress"`
}
